﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="view_sub_vote.ascx.cs" Inherits="vboard_component_board_template_default_view_sub_vote" %>

<div class="view_sub_vote">

	<div class="CommonBox">
		<div class="Header">Vote</div>
		<div class="Content">
			<div class="Question"><asp:Literal ID="VoteQuestionLiteral" runat="server" EnableViewState="false" /></div>
			<div class="Period"><asp:Literal ID="VotePeriodLiteral" runat="server" EnableViewState="false" /></div>
			<div class="Open"><asp:Literal ID="VoteIsOpenLiteral" runat="server" EnableViewState="false" Text="<%$ Resources:Vote_OpenDescription %>" Visible="false" /></div>

			<asp:UpdatePanel ID="VoteUpdatePanel" runat="server" UpdateMode="Conditional">
				<ContentTemplate>
					<asp:Panel ID="VoteResult" runat="server">
						<div class="TotalVoteCount"><asp:Literal ID="TotalVoteCountLiteral" runat="server" /></div>
						<asp:Repeater ID="VoteAsnwerRepeater" runat="server"
							OnItemDataBound="VoteAsnwerRepeater_ItemDataBound">
							<ItemTemplate>
								<div class="Answers">
									<div><%# Eval("Answer") %></div>
									<div style="float : left; width : 300px; background-image : url('<%# ResolveClientUrl("~/vboard/common/image/symbol/bar_bg.gif") %>');">
										<img src="<%# ResolveClientUrl(String.Format("~/vboard/common/image/symbol/bar_{0}.gif", Eval("Index"))) %>"
											width="<%# String.Format("{0:F0}", (Decimal)Eval("Percentage") / 100 * 300) %>"
											height="20"
											alt="Bar" /></div>
									<div>
										<div class="Count"><%# String.Format("{0}표", Eval("VoteCount")) %></div>
										<div class="Count"><%# String.Format("{0:F1}%", Eval("Percentage")) %></div>&nbsp;
									</div>
									<asp:Repeater ID="AnswerVoterRepeater" runat="server">
										<HeaderTemplate><div class="AnswerVoter">(</HeaderTemplate>
										<ItemTemplate><%# Eval("UserName") %></ItemTemplate>
										<SeparatorTemplate>,&nbsp;</SeparatorTemplate>
										<FooterTemplate>)</div></FooterTemplate>
									</asp:Repeater>
								</div>
							</ItemTemplate>
						</asp:Repeater>

						<asp:Repeater ID="VoterRepeater" runat="server" EnableViewState="false">
							<HeaderTemplate><div class="Voter"><div class="VoterHeader"><%= GetLocalResourceObject("Vote_VoterHeader").ToString() %></div></HeaderTemplate>
							<ItemTemplate><%# Eval("UserName") %></ItemTemplate>
							<SeparatorTemplate>,&nbsp;</SeparatorTemplate>
							<FooterTemplate></div></FooterTemplate>
						</asp:Repeater>
					</asp:Panel>

					<asp:Panel ID="VoteForm" runat="server">
						<asp:PlaceHolder ID="AnswerPlaceHolder" runat="server" />
						<asp:Button ID="ViewResultButton" runat="server" Text="결과보기" OnClick="ViewResultButton_Click" />
						<asp:Button ID="DoVoteButton" runat="server" Text="투표 참여" OnClick="DoVoteButton_Click" />
					</asp:Panel>

					<asp:UpdateProgress ID="VoteUpdatePanelProgress" runat="server" AssociatedUpdatePanelID="VoteUpdatePanel" DisplayAfter="0">
						<ProgressTemplate>
							<div class="VWebGlobal_UpdateProgressPanel"><asp:Image ID="LoaderImage1" runat="server" ImageUrl="~/vboard/common/image/loader.gif" /> <%= VUtility.GetVWebGlobalResource("General_UpdateProgressMessage") %></div>
						</ProgressTemplate>
					</asp:UpdateProgress>
				</ContentTemplate>
			</asp:UpdatePanel>
		</div>
	</div>
</div>